from odoo import fields, models

class Cost_Analysis(models.Model):
    _name = 'cost.analysis'
    _description = '成本分析'
    name = fields.Char('成本分析项目名')
    from_date = fields.Date('开始日期')
    to_date = fields.Date('结束时间')
    #  仓库一对多 Warehouse = fields.Many2one('res.Warehouse',String='仓库')
    warehouse = fields.Many2one('hotel.stock',string='仓库')
    # Many2one
    type = fields.Many2one('commodity.type',string='类型')
    project_simple = fields.Char('项目简拼')


    # 下面的表数据
    goods_id = fields.Char('商品编号')
    project_name = fields.Char('项目名称')
    cost_average = fields.Float('成本均价')
    price_average = fields.Float('平均售价')
    sale_volumes = fields.Integer('销售数量')
    cost_all = fields.Float('成本总额')
    sale_all = fields.Float('销售总额')
    gross_profit = fields.Float('毛利')

